home *** CD-ROM | disk | FTP | other *** search
- #ifndef _WIDGET_H
- #define _WIDGET_H
-
- /*
- * $Log: widget.h,v $
- * Revision 1.2 89/08/15 14:26:44 bammi
- * cleanup
- *
- * Revision 1.2 89/03/05 20:38:42 bammi
- * Port to minixST gcc + gcc curses lib
- *
- * Revision 1.1 89/03/05 20:31:01 bammi
- * Sources as distributed in comp.sources
- *
- *
- */
-
- /*****************************************************************************
- /* FILE: widget.h
- /* DATE: August 1988.
- /* AUTHOR: Richard A. Culshaw.
- /* DESCRIPTION: Contains the definitions of the widget structures.
- /* It should be included by all programs that want to
- /* use the widget library.
- /* DISCLAIMER: This file is deemed to be public-domain, on the simple
- /* provisos that this section remains in this file and
- /* that code using it do not do so for monetary gain.
- /* Neither the author, nor the authors employees at the
- /* time of developing this code, accept any liability or
- /* responsibility for the use, abuse or misuse of this
- /* code.
- /*****************************************************************************/
-
- #include <curses.h>
-
- /* definition for command widget entry in linked list */
- struct cmdwid{
- WINDOW *widget;
- int id;
- char msg[100];
- char acpt;
- int (*func)();
- int length;
- int x,y;
- int active;
- struct cmdwid *next;
- } *cmdlist;
-
- /* definition for label widget entry in linked list */
- struct lblwid{
- WINDOW *widget;
- int id;
- char msg[100];
- char pos;
- int length;
- int difference;
- int x,y;
- struct lblwid *next;
- } *lbllist;
-
- /* definition for togle widget entry in linked list */
- struct tglwid{
- WINDOW *widget;
- int id;
- char msg[100];
- char tgl[10][20];
- char toggle;
- int cur;
- int total;
- int length;
- int xtgl;
- int x,y;
- int active;
- struct tglwid *next;
- } *tgllist;
-
- /* definition for input widget entry in linked list */
- struct inpwid{
- WINDOW *widget;
- int id;
- char msg[100];
- char acpt;
- char *input;
- int sofi;
- int exec;
- int lofs;
- int length;
- int x,y;
- int active;
- struct inpwid *next;
- } *inplist;
-
- /* linked list of characters used for activating widgets */
- struct chentry {
- char ch;
- int type;
- int id;
- struct chentry *next;
- } *actlist;
-
- /* null entries in the various linked list */
- #define NULLCMD (struct cmdwid *)NULL
- #define NULLLBL (struct lblwid *)NULL
- #define NULLTGL (struct tglwid *)NULL
- #define NULLINP (struct inpwid *)NULL
- #define NULLCH (struct chentry *)NULL
-
- /* part of the specifications for label widgets */
- #define CENTRE 1
- #define LEFTJUST 2
- #define RIGHTJUST 4
- #define NOHIGH 8
-
- /* the types of the widgets */
- #define CMD 1
- #define TGL 2
- #define LBL 3
- #define INP 4
-
- #define BLANK 1
- #define NOBLANK 0
-
- #define NULLWIDGET 0
-
- #define EXEC 1
- #define NOEXEC 0
-
- #define VERTICAL 1
- #define HORIZONTAL 2
-
- typedef int WIDGET;
- typedef int WIDGETTYPE;
-
- #ifdef __STDC__
- #ifndef __NO_PROTO__
-
- int activate(WIDGET);
- int addtochlist(int, int, WIDGETTYPE);
-
- void boxwidget(WINDOW *, int);
-
- int chactive(WIDGET, int, int);
- int changelblwidget(WIDGET, char *, int);
- void cleartextwindow(void);
-
- int deactivate(WIDGET, int);
- int dehighlight(WIDGET);
- void deletechentry(int);
- void drawcmdwidget(WINDOW *, char *, int, int, int);
- void drawinpwidget(WINDOW *, char *, int, int, int, int);
- void drawlblwidget(WINDOW *, char *, int, int, int, int);
- void drawtextwindow(int);
- void drawtglwidget(WINDOW *, char *, char *, int, int, int);
-
- void endwidgets(void);
-
- int getinput(WIDGET);
-
- int highlight(WIDGET);
- void home(void);
-
- void initialisewidgets(void);
-
- void killcmdwidget(WIDGET);
- void killinpwidget(WIDGET);
- void killlblwidget(WIDGET);
- void killtextwindow(void);
- void killtglwidget(WIDGET);
- int killwidget(WIDGET);
-
- int light(WIDGET, int);
-
- WIDGET mkcmdwidget(char *, int, int (*)(), int);
- WIDGET mkinpwidget(char *, int, char *, int, int, int, int);
- WIDGET mklblwidget(char *, int, int, int);
- WIDGET mktglwidget(char *, int, char **, int, int);
-
- int opentextwindow(int, int);
-
- void report(char *);
-
- void screenrefresh(void);
-
- void togglewidget(WIDGET);
- int tsttglwidget(WIDGET);
-
- WIDGET widgetinput(void);
- WIDGETTYPE widgettype(WIDGET);
-
- #endif /* __NO_PROTO__ */
- #endif /* __STDC__ */
-
- #endif /* _WIDGET_H */
-